# 导入内置模块
import smtplib
from email.mime.text import MIMEText
from email.utils import  formataddr

# 构建邮件内容
msg = MIMEText('领导早上好，领导今天辛苦了。','html','utf-8')
msg['From'] = formataddr(['吴佩琦','wyl350@126.com'])
msg['to'] = 'wyl350@126.com'
msg['Subject'] = '日常信息'

# 发送邮件
server = smtplib.SMTP_SSL('smtp.126.com')
server.login('wyl350@126.com','VRPSTIZRBCKNCMDT')

# 自己邮箱 目标邮箱
server.sendmail('wyl350@126.com', 'wyl350@126.com',msg.as_string())
server.quit()
